<div class="findtrs">
	<form action="" class="layui-inline layui-form" method="post" style="width: 100%">
		{include file="cards/card_info_header"/}
		<div class="fremittanpred fbai" style="height: 450px;">
			{include file="cards/card_info_menu"/}
			<div class="list" style="padding-bottom: 200px;">
				<table id="balanceTable" lay-filter="balanceTable"></table>
			</div>
			<input type="hidden" value="{$card_id}" name="card_id">
			<input type="hidden" value="del" name="type">
			<div class="fbottonlst" style="float: left">
				<ul>
					<li class="on">
						<input type="button" class="fsubmit" lay-submit lay-filter="edit" style="float: left" value="提 交" >
					</li>
					<li><a href="{:url('cards/cardList')}">返回</a></li>
				</ul>
			</div>

		</div>
	</form>
</div>
<script type="text/javascript">
	layui.use(['table'], function () {
		var table = layui.table;

		table.render({
			elem: '#balanceTable',
			height: '350',
			cellMinWidth: '50',
			method: 'post',
			where:{card_id:"{$card_id}"},
			url: "{:url('cards/cardInfoLog')}",
			id: 'balanceTable',
			text:{none: 'No Data'},
			error: function(){
				setTimeout("window.location.href='" + "{:url('index/index')}" + "'; ", 1000);
			},
			cols: [[
				{ type: 'numbers'},
				{ title: '操作时间',
					templet: function (d) {
						return layui.util.toDateString(d.ctime * 1000, "yyyy-MM-dd HH:mm:ss");
					}
				},
				{ field: '', align: 'left', title: '类型' ,
					templet: function (d) {
						const type_name = d.type;
						switch (type_name) {
							case '1':
								return '建卡';
								break;
							case '2':
								return '增加余额';
								break;
							case '3':
								return '减少余额';
								break;
							case '4':
								return '删卡';
								break;
							case '5':
								return '消费';
								break;
							case '6':
								return '消费退款';
								break;
							case '7':
								return '消费手续费';
								break;
						}
					}
				},
				{ field: 'amount',  align: 'left', title: '变化金额($)',
					style:'font-weight:bold'},
				{ field: 'balance',  align: 'left', title: '卡限额($)',
					style:'font-weight:bold'},
				{ field: 'desc',  align: 'left', title: '备注'},
			]],
			page: true,
			limit: 20,
			limits: [20, 50, 100],
		});
	});
</script>